﻿using System;
using System.Data;
using Loki.Data;

namespace Luna.Data.Mappers
{
    public abstract class LunaEntityMapper<TDataEntity, TDataEntityInterface> : EntityMapper<TDataEntity, TDataEntityInterface, Guid>
        where TDataEntity : TDataEntityInterface
        where TDataEntityInterface : ILunaData
    {
        public const string COL_ID = "PK";

        public LunaEntityMapper()
        {
            Factory = new DefaultFactory<TDataEntity>();
            IDParameterName = COL_ID;
        }

        protected override Func<IDataRecord, string, Guid> IDConverter
        {
            get { return DatabaseUtils.GetGuid; }
        }
    }
}
